using System;
using Holoville.HOTween;
using Holoville.HOTween.Core;
using UnityEngine;

public class HOTweenScaleButton : MonoBehaviour
{
	private UIWidget widjet;

	private void Awake()
	{
		HOTween.Init();
		widjet = base.transform.GetComponent<UIWidget>();
	}

	private void OnPress(bool isDown)
	{
		if (isDown)
		{
			showFirstScale();
		}
	}

	public void ScaleButton(UIWidget widjet, float scale, float time, Action callBack)
	{
		HOTween.To(widjet.transform, time, new TweenParms().Prop("localScale", Vector3.one * scale).OnComplete((TweenDelegate.TweenCallback)delegate
		{
			if (callBack != null)
			{
				callBack();
			}
		}));
	}

	public void showFirstScale()
	{
		ScaleButton(widjet, 0.97f, 0.1f, showSeconScale);
	}

	public void showSeconScale()
	{
		ScaleButton(widjet, 1.007f, 0.17f, showThirdScale);
	}

	public void showThirdScale()
	{
		ScaleButton(widjet, 1f, 0.28f, null);
	}
}
